﻿@{ Layout = null;
  
}
@inject IDbServerService mService
@model TargetDbServerModel

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">选择目标服务器</h4>
</div>
<div class="modal-body">
    <div class="ibox float-e-margins">
        <div class="ibox-content text-center p-md">
            <form id="dynamic-Target-DbServer-form" asp-action="DbServer" method="post" class="form-horizontal" role="form">
                <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                <input type="hidden" asp-for="SourceServerId" />
                <input type="hidden" asp-for="SourceTableId" />
                <div class="form-group">
                    <label asp-for="TargetServerId" class="col-md-3 control-label text-right"> 目标服务器</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <select class="select2" asp-for="TargetServerId" validate="{required:true}">
                                @{

                                    if (Model.DbServers != null && Model.DbServers.Count > 0)
                                    {
                                        foreach (var item in Model.DbServers)
                                        {
                                            @Html.Raw("<option value='" + item.DbServerId + "'>" + item.LocalName + (item.DbServerName!=item.LocalName?"("+item.DbServerName + ")":"") + "</option>")
                                        }
                                    }
                                }
                            </select>
                        </div>
                        <span asp-validation-for="TargetServerId" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="TargetTableName" class="col-md-3 control-label text-right">目标表</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <input asp-for="TargetTableName" class="form-control" validate="{required:false ,maxlength:50   }" />
                        </div>
                        <span asp-validation-for="TargetTableName" class="text-danger"></span>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>
<div class="modal-footer">

</div>
